package com.newegg.bigmap.config;

import java.io.IOException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import indi.fritz.bigmap.MapBuild;
import indi.fritz.bigmap.volme.Engine;

@Configuration
@Component
public class DatabaseConfig {
	
	@Value("${database.path}")
	String databasePath;

	@Bean
	public Engine getDiskEngine() throws IOException{
		return MapBuild.Build(databasePath).createIfNotExist(true).clearOnOpen(false).exclusive(true).build();
	}
}
